<!--#include file="config.asp"-->
<!--#include file="admin/inc/FORMAT.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>demo - userreg</title>
</head>

<body>
<script language="JavaScript">
<!---
function checkform(theform)
{
if(theform.userName.value == "")
{
	alert("user not null");
	theform.userName.focus();
	return false;
}
if(theform.passWord.value == "")
{
	alert("password not null");
	theform.passWord.focus();
	return false;
}
if(theform.passWord.value != theform.passWord1.value)
{
	alert("error");
	theform.passWord.focus();
	return false;
}

if(theform.email.value == "")
{
	alert("email not null");
	theform.email.focus();
	return false;
}
if(theform.address.value == "")
{
	alert("address not null");
	theform.address.focus();
	return false;
}
}
-->
</script>

<%
if request("Submit") = "ok" then
			set rs = conn.execute("select * from userInfo where userName = '"&strreplace(request.Form("userName"))&"'")
			if not(rs.eof and rs.bof) then
				response.Write("<script>alert('error!');history.go(-1)</script>")
				response.End()
			else	
				set rs=server.createobject("adodb.recordset")
				sqltext="select * from userInfo"
				rs.open sqltext,conn,3,3
				rs.addnew
				rs("userName") = request.Form("userName")
				rs("passWord") = request.Form("passWord")
				rs("trueName") = request.Form("trueName")
				rs("email") = request.Form("email")
				rs("address") = request.Form("address")
				rs("ZIP") = request.Form("ZIP")
				rs("tel") = request.Form("tel")
				rs("mobile") = request.Form("mobile")
				rs("sfz") = request.Form("sfz")
				rs("content") = request.Form("content")
				rs.update
				rs.close
				Response.write "<script language = 'javascript'>alert('success!');history.go(-1);</script>"
			end if
end if
%>

<table width="528" height="230" border="0" align="center" cellpadding="3" cellspacing="0" class="font21">
  <form name="form1" method="post" action="" onSubmit="return checkform(this)">
    <tr> 
      <td width="110">username</td>
      <td width="406"><input type="text" name="userName">
        * </td>
    </tr>
    <tr> 
      <td>password</td>
      <td><input type="password" name="passWord">
        *</td>
    </tr>
    <tr> 
      <td>password</td>
      <td><input type="password" name="passWord1">
        *</td>
    </tr>
    <tr> 
      <td>truename</td>
      <td><input type="text" name="trueName">
        *</td>
    </tr>
    <tr> 
      <td>email</td>
      <td><input type="text" name="email">
        * </td>
    </tr>
    <tr> 
      <td>address</td>
      <td><input type="text" name="address">
        *</td>
    </tr>
    <tr> 
      <td>ZIP</td>
      <td><input type="text" name="ZIP"></td>
    </tr>
    <tr> 
      <td>tel</td>
      <td><input type="text" name="tel">
        (+86-577-88888888)</td>
    </tr>
    <tr> 
      <td>mobile</td>
      <td><input type="text" name="mobile"></td>
    </tr>
    <tr> 
      <td>card</td>
      <td><input type="text" name="sfz"></td>
    </tr>
    <tr> 
      <td>other</td>
      <td><textarea name="content" rows="7"></textarea> </td>
    </tr>
    <tr align="center"> 
      <td colspan="2"><input type="hidden" name="Submit" value="ok">
        <input type="submit" name="Submit2" value="register">
        <input type="reset" name="Submit3" value="cancel"> </td>
    </tr>
  </form>
</table>
</body>
</html>
